From 1c3ccd356570bed9fbdd6364e252ddd14b244884 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 9 Oct 2005 08:32:39 +0000 Subject: [PATCH] * (bug 3660) Update diff3 detection to work with Windows/Cygwin patch from Goodwill: http://bugzilla.wikimedia.org/attachment.cgi?id=960 --- RELEASE-NOTES | 1 + config/index.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e369afeba8..4c7e8ffe88 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -134,6 +134,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 3629) Fix date & time format for Frisian * (bug 3643) Fix image page display of large images with resizing disabled * (bug 3334) Namespace changes for Polish +* (bug 3660) Update diff3 detection to work with Windows/Cygwin === Caveats === diff --git a/config/index.php b/config/index.php index a42e7e6fca..4225858280 100644 --- a/config/index.php +++ b/config/index.php @@ -316,8 +316,8 @@ if (!$conf->turck && !$conf->eaccel) { } $conf->diff3 = false; -$diff3locations = array("/usr/bin", "/opt/csw/bin", "/usr/gnu/bin", "/usr/sfw/bin") + explode(":", getenv("PATH")); -$diff3names = array("gdiff3", "diff3"); +$diff3locations = array("/usr/bin", "/opt/csw/bin", "/usr/gnu/bin", "/usr/sfw/bin") + explode($sep, getenv("PATH")); +$diff3names = array("gdiff3", "diff3", "diff3.exe"); $diff3versioninfo = array('$1 --version 2>&1', 'diff3 (GNU diffutils)'); foreach ($diff3locations as $loc) { @@ -1312,13 +1312,14 @@ function locate_executable($loc, $names, $versioninfo = false) { $names = array($names); foreach ($names as $name) { - if (file_exists("$loc/$name")) { + $command = "$loc".DIRECTORY_SEPARATOR."$name"; + if (file_exists($command)) { if (!$versioninfo) - return "$loc/$name"; + return $command; - $file = str_replace('$1', "$loc/$name", $versioninfo[0]); + $file = str_replace('$1', $command, $versioninfo[0]); if (strstr(`$file`, $versioninfo[1]) !== false) - return "$loc/$name"; + return $command; } } return false; -- 2.20.1